package com.vilen.retrofit2helloworld_1;

import android.os.Bundle;
import android.widget.EditText;
import com.vilen.retrofit2helloworld_1.domain.ResponseJson3;
import com.vilen.retrofit2helloworld_1.domain.User;
import nucleus.factory.RequiresPresenter;
import nucleus.view.NucleusActivity;

@RequiresPresenter(MainRxMvpPresent.class)
public class MainRxMvpActivity extends NucleusActivity<MainRxMvpPresent> {
  private EditText mEditText;
  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_mvp_main);
    mEditText = (EditText) findViewById(R.id.editText);
    getPresenter().request();
  }

  public void onItems(ResponseJson3<User> responseJson3) {
    mEditText.setText(responseJson3.getData().get(0).toString());
  }
}
